package com.atguigu.e_duration;

import java.time.Duration;
import java.time.LocalDateTime;

public class Demo {
    public static void main(String[] args) {
        //创建时分秒的时间间隔对象
        Duration duration = Duration.between(LocalDateTime.of(1991, 1, 1, 0, 0, 0)
                , LocalDateTime.now());

        //PT 287267H 54M 29.2992166S
        System.out.println("duration = " + duration);


        //快速获取这个时间间隔对象中间隔的天数
        long days = duration.toDays();
        System.out.println("days = " + days);//11969
    }
}
